/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

/**
 *
 * @author Elias Mendoza
 */
@Embeddable
public class GrupoLecturaPK implements Serializable{
  @ManyToOne(cascade= CascadeType.ALL)
  private Grupo grupoFK;
  @ManyToOne(cascade= CascadeType.ALL)
  private Lectura lecturaFK;

  public GrupoLecturaPK() {
  }

  public Grupo getGrupoFK() {
    return grupoFK;
  }

  public void setGrupoFK(Grupo grupoFK) {
    this.grupoFK = grupoFK;
  }

  public Lectura getLecturaFK() {
    return lecturaFK;
  }

  public void setLecturaFK(Lectura lecturaFK) {
    this.lecturaFK = lecturaFK;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final GrupoLecturaPK other = (GrupoLecturaPK) obj;
    if (this.grupoFK != other.grupoFK && (this.grupoFK == null || !this.grupoFK.equals(other.grupoFK))) {
      return false;
    }
    if (this.lecturaFK != other.lecturaFK && (this.lecturaFK == null || !this.lecturaFK.equals(other.lecturaFK))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 5;
    hash = 89 * hash + (this.grupoFK != null ? this.grupoFK.hashCode() : 0);
    hash = 89 * hash + (this.lecturaFK != null ? this.lecturaFK.hashCode() : 0);
    return hash;
  }
  
  
}
